﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Windows.Data;
using MyPublisher.Administration.Commands;
using System.Windows.ApplicationFramework;
using System.Collections.ObjectModel;
using MyPublisher.Administration.Model;
using MyPublisher.Administration.Views;

namespace MyPublisher.Administration.ViewModels
{
    public class AdminViewModel : DocumentViewModel<AdminDocument>
    {
        public ObservableCollection<ConfigurationElement> Configurations { get; set; }

        public AdminViewModel(IView view,string name)
            : base(view, name)
        {
            this.Load();
        }

        public void Load()
        {
            this.Configurations = new ObservableCollection<ConfigurationElement>();

            ConfigurationElement phototypes = new ConfigurationElement("Types");
            phototypes.Items.Add(
                new ConfigurationElement("Application Types", 
                    new ApplicationTypesViewModel(new ApplicationTypesView(), "Application Types")));

            phototypes.Items.Add(
                new ConfigurationElement("Location Types",
                    new LocationTypesViewModel(new LocationTypesView(), "Location Types")));

            phototypes.Items.Add(
                new ConfigurationElement("Process Types",
                    new ProcessTypesViewModel(new ProcessTypesView(), "Process Types")));

            phototypes.Items.Add(
                new ConfigurationElement("Workflow Types",
                    new WorkflowTypesViewModel(new WorkflowTypesView(),"Workflow Types")));

            phototypes.Items.Add(new ConfigurationElement("Timer Types",
                new TimerTypesViewModel(new TimerTypesView(),"Timer Types")));

            phototypes.Items.Add(new ConfigurationElement("Privilege Types",
                new PrivilegeTypesViewModel(new PrivilegeTypesView(),"Privilege Types")));

            phototypes.Items.Add(new ConfigurationElement("Connector Types",
                new ConnectorTypesViewModel(new ConnectorTypesView(), "Connector Types")));

            ConfigurationElement configuration = new ConfigurationElement("System");
            configuration.Items.Add(
                new ConfigurationElement("Locations",
                    new LocationsViewModel(
                        new LocationsView(),"Locations")));

            configuration.Items.Add(
                new ConfigurationElement("Connectors",
                new ConnectorsViewModel(
                    new ConnectorsView(), "Connectors")));

            configuration.Items.Add(
                new ConfigurationElement("Identities",
                    new IdentiesViewModel(
                        new IdentiesView(), "Identities")));

            configuration.Items.Add(new ConfigurationElement("Schedule"));
            configuration.Items.Add(new ConfigurationElement("Workflow"));
            configuration.Items.Add(new ConfigurationElement("Format Protocol"));
            configuration.Items.Add(new ConfigurationElement("Parameters"));

            ConfigurationElement documentConfiguration = new ConfigurationElement("Monitor");
            documentConfiguration.Items.Add(new ConfigurationElement("Performance"));
            documentConfiguration.Items.Add(new ConfigurationElement("Log List"));

            Configurations.Add(phototypes);
            Configurations.Add(configuration);
            Configurations.Add(documentConfiguration);
        }
    }
}
